IsSubsetOf Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Determines if this bag is a subset of another bag. Neither bag is modified. This bag is a subset of otherBag if every element in this bag is also in otherBag, at least the same number of times.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public bool IsSubsetOf(
	OrderedBag<T> otherBag
)
Visual Basic (Declaration)
Public Function IsSubsetOf ( _
	otherBag As OrderedBag(Of T) _
) As Boolean
Visual C++
public:
bool IsSubsetOf (
	OrderedBag<T>^ otherBag
)

Parameters

otherBag
OrderedBag<(Of <T>)>
OrderedBag to compare to.

Return Value

True if this is a subset of otherBag.

Remarks

IsSubsetOf is computed in time O(N log M), where M is the size of the otherBag, and N is the size of the this bag.

Exceptions

ExceptionCondition
System..::InvalidOperationExceptionThis bag and otherBag don't use the same method for comparing items.
System..::ArgumentNullExceptionotherBag is null.

See Also